{% extends 'common/table_layout.html' %}
{% block content %}
    <div class="layui-card-body">
        <form class="layui-form" novalidate id="negotiation_form"
              lay-filter="negotiation_form" method="post">
            <div class="layui-row">

                <!-- 基础信息-->
                {% for field in form %}

                    <div class="layui-col-xs6">
                        <div class="layui-form-item">
                            {% if field.field.required %}
                                <span style="color: red">{{ field.errors.0 }}</span>
                                <label class="layui-form-label label-required-next">
                                    {{ field.label }}</label>
                            {% else %}
                                <label class="layui-form-label">
                                    {{ field.label }}</label>
                            {% endif %}
                            <div class="layui-input-block">
                                {{ field }}
                            </div>
                        </div>
                    </div>

                {% endfor %}

            </div>

            <div style='margin:20px; '>
                <button class="layui-btn custom-button" lay-submit lay-filter="negotiation_add">确定</button>
            </div>
        </form>
    </div>

{% endblock %}
{% block js %}
    <script>
        layui.use(function () {
            var layer = layui.layer;

            {% for msg in messages %}
                var iconValue = "{{msg.tags}}" == 'success' ? 1 : 2;
                layer.msg(
                    '{{ msg }}',
                    {icon: iconValue, time: 2000},
                    function () {
                        //关闭弹窗
                        setTimeout("window.parent.location.reload();", 0)
                    }
                );
            {% endfor %}

        })
    </script>
{% endblock %}